<template>
  <a-modal title="处理反馈" :visible="disposeVisible" @cancel="cancel" @ok="ok">
    <a-input v-model="content" type="textarea" placeholder="" />
  </a-modal>
</template>

<script>
import { editFeedbackListApi } from '@/api/brand.js'
export default {
  components: {},
  data() {
    return {
      disposeVisible: false,
      content: '',
      ids: '',
      disposArr: []
    }
  },
  methods: {
    openewritedispose(json) {
      this.ids = json.id
      this.content = ''
      this.disposArr = json.result
      this.disposeVisible = true
    },
    handleOk() {
      this.disposeVisible = false
    },
    cancel() {
      this.handleOk()
    },

    ok() {
      if (!this.content) return this.$message.warn('请输入反馈信息')
      var arrs = this.disposArr
      arrs.push({
        content: this.content,
        ctime: Date.parse(new Date()) / 1000
      })
      editFeedbackListApi({
        ids: this.ids,
        status: 1,
        result: arrs,
        brand_id: process.env.VUE_APP_BRAND_ID
      }).then(res => {
        this.$message.success('操作成功')
        this.handleOk()
        this.$emit('changes')
      })
    }
  }
}
</script>

<style lang="less" scoped></style>
